package domain

import (
	"vrcm/src/vrcm/common/models"
)

type CacheExpireConfig struct {
	models.Model

	TenantId   string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	DomainId   int    `json:"domain_id" gorm:"type:bigint unsigned;comment:域名配置id"`
	CacheType  int    `json:"cache_type" gorm:"type:tinyint;comment:1 缓存 2不缓存 3遵循援站"`
	ExpireType int    `json:"expire_type" gorm:"type:tinyint;comment:过期时间类型 1 目录 2文件后缀名 3全路径匹配 4全部文件"`
	Content    string `json:"content" gorm:"type:varchar(200);comment:内容"`
	ExpireTime int    `json:"expire_time" gorm:"type:int;comment:过期时间"`
	Unit       int    `json:"unit" gorm:"type:tinyint;comment:1秒 2分 3时 4天 5月 6年"`
	CacheSet   int    `json:"cache_set" gorm:"type:tinyint;comment:1缓存 2不缓存 3遵循源站"`
	Sort       int    `json:"sort" gorm:"type:int;comment:排序"`
	Priority   int    `json:"priority" gorm:"type:int;comment:优先级"`
	models.ModelTime
	models.ControlBy
}

func (CacheExpireConfig) TableName() string {
	return "cache_expire_config"
}

func (e *CacheExpireConfig) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *CacheExpireConfig) GetId() interface{} {
	return e.Id
}

type StateCodeExpireConfig struct {
	models.Model

	TenantId   string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	DomainId   int    `json:"domain_id" gorm:"type:bigint unsigned;comment:域名配置id"`
	ExpireTime int    `json:"expire_time" gorm:"type:int;comment:过期时间"`
	StateCode  string `json:"state_code" gorm:"type:varchar(100);comment:状态码"`
	models.ModelTime
	models.ControlBy
}

func (StateCodeExpireConfig) TableName() string {
	return "state_code_expire_config"
}
